<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>编辑长者生活满意度调查表</title>
	<#include "/common/resource.ftl">
    <link rel="stylesheet" href="${params.contextPath}/static/plug/layui/css/layui.css">
    <link rel="stylesheet" href="${params.contextPath}/static/css/jquery-ui.min.css">
    <script src="${params.contextPath}/static/js/jquery-ui.min.js"></script>
    <style>
        .layui-form select {display:none !important;}
    </style>
	<script type="text/javascript">
		$(function () {
            <#if (params.tag)??>
            $( "#elderName").autocomplete({
                source: function(request, response) {
                    $.ajax({
                        url: "${params.contextPath}/web/elder/listAll.json",
                        dataType: "json",
                        data: {
                            name: $("#elderName").val().trim()
                        },
                        success: function(data) {
                            response($.map(data.data, function(item) {
                                return {
                                    value: item.name,
                                    id: item.id
                                }
                            }));
                        }
                    });

                },
                select: function(e, ui) {
                    $("[name='elderId']").val(ui.item.id);
                },
                maxLength: 2
            });
            <#else>
            LocalStorage.registHandler("elder_handler_select", function (data) {
                $('input[name="elderId"]').val(data.id);
                $('input[name="elderName"]').val(data.name);
            });
            </#if>
			<#if (params.id)??>
				$.ajaxRequest({
					url: '${params.contextPath}/web/seniorsSatisfactionQuestionnaire/query.json',
					data: {id: "${params.id}"},
					success: function (data) {
						if (!data.success) {
							$.message(data.message);
							return;
						}
						var record = data.data;
						for (var key in record) {
							$("[name='" + key + "']").val(record[key]);
						}
                        layui.form.render();
					}
				});
			</#if>

            $(".ajax-form").unbind().submit(function () {
                try {
                    var form = $(this);
                    if (!form.valid()) {
                        $.message("验证不通过，无法提交表单");
                        return false;
                    }

                    form.formSubmit({
                        callBack:function (data) {
                            <#if (params.tag)??>
                            history.go(-1);
                            </#if>
                        }
                    });
                } catch (e) {
                    console.log("表单提交错误：" + e);
                }
                return false;
            });
		});
	</script>
</head>
<body>
	<div class="ui-form">
		<form class="layui-form ajax-form" action="${params.contextPath}/web/seniorsSatisfactionQuestionnaire/<#if (params.id)??>modify<#else>save</#if>.json" method="post">
			<input type="hidden" name="id" value="${params.id}" />
            <div class="layui-card">
                <div class="layui-card-body">
                    <div class="layui-row">
                        <div class="layui-col-md12">
                            <#if (params.tag)??>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">老人<span class="ui-request">*</span></label>
                                    <div class="layui-input-block">
                                        <input type="hidden" name="elderId" id="elderId" value=""/>
                                        <input type="text" id="elderName" name="elderName" class="layui-input" autocomplete="off"/>
                                    </div>
                                </div>
                            <#else>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">老人<span class="ui-request">*</span></label>
                                    <div class="layui-input-block">
                                        <input type="hidden" name="elderId"/>
                                        <input type="text" name="elderName" placeholder="请选择老人" p="model:'elder',handlerId:'elder_handler_select'" class="layui-input single-model-select {required:true}" readonly>
                                    </div>
                                </div>
                            </#if>
                        </div>
                    </div>

                    <div class="layui-row">
                        <div class="layui-col-md6">
                            <div class="layui-form-item">
                                <label class="layui-form-label">护理员有无打骂、虐待长者<span class="ui-request">*</span></label>
                                <div class="layui-input-block">
                                    <select name="abuseElderStatus" class="layui-input {required:true}">
                                        <option value="">请选择</option>
                                        <option value="1">没有</option>
                                        <option value="2">少有</option>
                                        <option value="3">经常有</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="layui-col-md6">
                            <div class="layui-form-item">
                                <label class="layui-form-label">对护理员打骂长者建议<span class="ui-request">*</span></label>
                                <div class="layui-input-block">
                                    <input type="text" name="abuseElderStatusSuggest" placeholder="请输入对护理员打骂长者建议" class="layui-input"/>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="layui-row">
                        <div class="layui-col-md6">
                            <div class="layui-form-item">
                                <label class="layui-form-label">对护理员洗澡等是否满意<span class="ui-request">*</span></label>
                                <div class="layui-input-block">
                                    <select name="caregiverWashSatisfaction" class="layui-input {required:true}">
                                        <option value="">请选择</option>
                                        <option value="1">很满意</option>
                                        <option value="2">满意</option>
                                        <option value="3">比较满意</option>
                                        <option value="4">一般</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="layui-col-md6">
                            <div class="layui-form-item">
                                <label class="layui-form-label">对护理员洗澡等建议<span class="ui-request">*</span></label>
                                <div class="layui-input-block">
                                    <input type="text" name="caregiverWashSatisfactionSuggest" placeholder="请输入对护理员洗澡等建议" class="layui-input"/>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="layui-row">
                        <div class="layui-col-md6">
                            <div class="layui-form-item">
                                <label class="layui-form-label">护理员语气是否温和<span class="ui-request">*</span></label>
                                <div class="layui-input-block">
                                    <select name="caregiverGentleStatus" class="layui-input {required:true}">
                                        <option value="">请选择</option>
                                        <option value="1">很温和</option>
                                        <option value="2">一般</option>
                                        <option value="3">很凶</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="layui-col-md6">
                            <div class="layui-form-item">
                                <label class="layui-form-label">对护理员语气建议<span class="ui-request">*</span></label>
                                <div class="layui-input-block">
                                    <input type="text" name="caregiverGentleStatusSuggest" placeholder="请输入对护理员语气建议" class="layui-input"/>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="layui-row">
                        <div class="layui-col-md6">
                            <div class="layui-form-item">
                                <label class="layui-form-label">对护理员是否满意<span class="ui-request">*</span></label>
                                <div class="layui-input-block">
                                    <select name="caregiverSatisfactionStatus" class="layui-input {required:true}">
                                        <option value="">请选择</option>
                                        <option value="1">很满意</option>
                                        <option value="2">满意</option>
                                        <option value="3">比较满意</option>
                                        <option value="4">一般</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="layui-col-md6">
                            <div class="layui-form-item">
                                <label class="layui-form-label">对护理员满意度建议<span class="ui-request">*</span></label>
                                <div class="layui-input-block">
                                    <input type="text" name="caregiverSatisfactionStatusSuggest" placeholder="请输入对护理员满意度建议" class="layui-input"/>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="layui-row">
                        <div class="layui-col-md6">
                            <div class="layui-form-item">
                                <label class="layui-form-label">医生服务满意度<span class="ui-request">*</span></label>
                                <div class="layui-input-block">
                                    <select name="doctorServiceSatisfactionStatus" class="layui-input {required:true}">
                                        <option value="">请选择</option>
                                        <option value="1">很满意</option>
                                        <option value="2">满意</option>
                                        <option value="3">比较满意</option>
                                        <option value="4">一般</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="layui-col-md6">
                            <div class="layui-form-item">
                                <label class="layui-form-label">对医生服务建议<span class="ui-request">*</span></label>
                                <div class="layui-input-block">
                                    <input type="text" name="doctorServiceSatisfactionStatusSuggest" placeholder="请输入对医生服务建议" class="layui-input"/>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="layui-row">
                        <div class="layui-col-md6">
                            <div class="layui-form-item">
                                <label class="layui-form-label">护士服务满意度<span class="ui-request">*</span></label>
                                <div class="layui-input-block">
                                    <select name="nurseServiceSatisfactionStatus" class="layui-input {required:true}">
                                        <option value="">请选择</option>
                                        <option value="1">很满意</option>
                                        <option value="2">满意</option>
                                        <option value="3">比较满意</option>
                                        <option value="4">一般</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="layui-col-md6">
                            <div class="layui-form-item">
                                <label class="layui-form-label">对护士服务建议<span class="ui-request">*</span></label>
                                <div class="layui-input-block">
                                    <input type="text" name="nurseServiceSatisfactionStatusSuggest" placeholder="请输入对护士服务建议" class="layui-input"/>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="layui-row">
                        <div class="layui-col-md6">
                            <div class="layui-form-item">
                                <label class="layui-form-label">日常活动是否丰富<span class="ui-request">*</span></label>
                                <div class="layui-input-block">
                                    <select name="dailyActivitiesAbundant" class="layui-input {required:true}">
                                        <option value="">请选择</option>
                                        <option value="1">很丰富</option>
                                        <option value="2">丰富</option>
                                        <option value="3">比较丰富</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="layui-col-md6">
                            <div class="layui-form-item">
                                <label class="layui-form-label">日常活动建议<span class="ui-request">*</span></label>
                                <div class="layui-input-block">
                                    <input type="text" name="dailyActivitiesAbundantSuggest" placeholder="请输入日常活动建议" class="layui-input"/>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="layui-row">
                        <div class="layui-col-md6">
                            <div class="layui-form-item">
                                <label class="layui-form-label">伙食满意度<span class="ui-request">*</span></label>
                                <div class="layui-input-block">
                                    <select name="mealSatisfactionStatus" class="layui-input {required:true}">
                                        <option value="">请选择</option>
                                        <option value="1">很满意</option>
                                        <option value="2">满意</option>
                                        <option value="3">比较满意</option>
                                        <option value="4">一般</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="layui-col-md6">
                            <div class="layui-form-item">
                                <label class="layui-form-label">伙食建议<span class="ui-request">*</span></label>
                                <div class="layui-input-block">
                                    <input type="text" name="mealSatisfactionStatusSuggest" placeholder="请输入伙食建议" class="layui-input"/>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="layui-row">
                        <div class="layui-col-md6">
                            <div class="layui-form-item">
                                <label class="layui-form-label">其他各方面服务满意度<span class="ui-request">*</span></label>
                                <div class="layui-input-block">
                                    <select name="otherServiceSatisfactionStatus" class="layui-input {required:true}">
                                        <option value="">请选择</option>
                                        <option value="1">很满意</option>
                                        <option value="2">满意</option>
                                        <option value="3">比较满意</option>
                                        <option value="4">一般</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="layui-col-md6">
                            <div class="layui-form-item">
                                <label class="layui-form-label">其他各方面服务建议<span class="ui-request">*</span></label>
                                <div class="layui-input-block">
                                    <input type="text" name="otherServiceSatisfactionStatusSuggest" placeholder="请输入其他各方面服务建议" class="layui-input"/>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="layui-row">
                        <div class="layui-col-md6">
                            <div class="layui-form-item">
                                <label class="layui-form-label">环境卫生满意度<span class="ui-request">*</span></label>
                                <div class="layui-input-block">
                                    <select name="environmentSatisfactionStatus" class="layui-input {required:true}">
                                        <option value="">请选择</option>
                                        <option value="1">很满意</option>
                                        <option value="2">满意</option>
                                        <option value="3">比较满意</option>
                                        <option value="4">一般</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="layui-col-md6">
                            <div class="layui-form-item">
                                <label class="layui-form-label">环境卫生建议<span class="ui-request">*</span></label>
                                <div class="layui-input-block">
                                    <input type="text" name="environmentSatisfactionStatusSuggest" placeholder="请输入环境卫生建议" class="layui-input"/>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="layui-row">
                        <div class="layui-col-md6">
                            <div class="layui-form-item">
                                <label class="layui-form-label">问题解决及时性<span class="ui-request">*</span></label>
                                <div class="layui-input-block">
                                    <select name="resolveProblemSatisfactionStatus" class="layui-input {required:true}">
                                        <option value="">请选择</option>
                                        <option value="1">很及时</option>
                                        <option value="2">及时</option>
                                        <option value="3">比较及时</option>
                                        <option value="4">不及时</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="layui-col-md6">
                            <div class="layui-form-item">
                                <label class="layui-form-label">解决问题及时性建议<span class="ui-request">*</span></label>
                                <div class="layui-input-block">
                                    <input type="text" name="resolveProblemSatisfactionStatusSuggest" placeholder="请输入解决问题及时性建议" class="layui-input"/>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="layui-row">
                        <div class="layui-col-md6">
                            <div class="layui-form-item">
                                <label class="layui-form-label">相比入住前生活质量是否提高<span class="ui-request">*</span></label>
                                <div class="layui-input-block">
                                    <select name="improveQualityStatus" class="layui-input {required:true}">
                                        <option value="">请选择</option>
                                        <option value="1">很大提高</option>
                                        <option value="2">有些提高</option>
                                        <option value="3">没有提高</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="layui-col-md6">
                            <div class="layui-form-item">
                                <label class="layui-form-label">生活质量提高建议<span class="ui-request">*</span></label>
                                <div class="layui-input-block">
                                    <input type="text" name="improveQualityStatusSuggest" placeholder="请输入生活质量提高建议" class="layui-input"/>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="layui-row">
                        <div class="layui-col-md12">
                            <div class="layui-form-item">
                                <label class="layui-form-label">对养老中心建议<span class="ui-request">*</span></label>
                                <div class="layui-input-block">
                                    <textarea type="text" name="pensionCenterSuggestion" class="layui-textarea {required:true}" maxlength="500"></textarea>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-row">
                        <div class="layui-col-md12">
                            <div class="layui-form-item">
                                <label class="layui-form-label">对工作人员建议<span class="ui-request">*</span></label>
                                <div class="layui-input-block">
                                    <textarea type="text" name="workerSuggestion" class="layui-textarea {required:true}" maxlength="500"></textarea>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-row">
                        <div class="layui-col-md12">
                            <div class="layui-form-item">
                                <label class="layui-form-label">期望老年生活<span class="ui-request">*</span></label>
                                <div class="layui-input-block">
                                    <textarea type="text" name="expectElderLife" class="layui-textarea {required:true}" maxlength="500"></textarea>
                                </div>
                            </div>
                        </div>
                    </div>

                </div>
            </div>

			<div class="layui-form-item">
				<div class="layui-input-block">
					<input type="submit" value="保存" class="layui-btn" />
				</div>
			</div>
		</form>
	</div>
</body>
<script src="${params.contextPath}/static/plug/layui/layui.all.js"></script>
</html>
